package com.hqyj.storage.controller;


import com.hqyj.storage.dto.StorageInfo;
import com.hqyj.storage.service.StorageService;
import com.hqyj.utils.ResultUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sdx2009
 * @since 2022-09-30
 */
@RestController
@RequestMapping("/api/storage")
public class StorageController {
    @Autowired
    private StorageService storageService;

    @PostMapping("/storageIndex")
    public ResultUtils storageIndex(StorageInfo storageInfo){
        return storageService.storageIndex(storageInfo);
    }

    @PostMapping("/selectStorage")
    public ResultUtils selectStorage(){
        return storageService.selectStorage();
    }

    @PostMapping("storageUpdate")
    public ResultUtils storageUpdate(StorageInfo storageInfo){
        return storageService.storageUpdate(storageInfo);
    }

    @PostMapping("addStorage")
    public ResultUtils addStorage(StorageInfo storageInfo){
        return storageService.addStorage(storageInfo);
    }

    @PostMapping("deleteStorage")
    public ResultUtils deleteStorage(StorageInfo storageInfo){
        return storageService.deleteStorage(storageInfo);
    }
}
